package com.umeng.soexample.mvp.view.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.umeng.soexample.R;
import com.umeng.soexample.bean.GoodsValuesEntity;
import com.umeng.soexample.network.API;

import java.util.List;

public class GoodsValuesFragmentAdapter extends BaseMultiItemQuickAdapter<GoodsValuesEntity.ValuesBean.ImgsBean, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public GoodsValuesFragmentAdapter(List<GoodsValuesEntity.ValuesBean.ImgsBean> data) {
        super(data);
        addItemType(0, R.layout.item_goods_values_sp);
        addItemType(1, R.layout.item_goods_values_spxx);
        addItemType(2, R.layout.item_goods_values_cmxx);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsValuesEntity.ValuesBean.ImgsBean item) {
        if (helper.getItemViewType() == 0){
            ImageView imageView = helper.getView(R.id.iv_item_goods_values_sp);
            Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.goods_img_path).into(imageView);
        }else if (helper.getItemViewType() == 1){

        }else if (helper.getItemViewType() == 2){

        } else{

        }

    }
}
